package sk.tramtatiri.core;

/**
 * 
 * Exist more formulas to compute basal metabolism:<br />
 * http://www.chudnutie-ako.sk/sport-chudnutie/vypocet-bazalneho-metabolizmu/<br />
 * www.fitnesspark.sk<br /><br />
 * 
 * we use this from www.fitnesspark.sk
 * 
 * dont care with: <br />
 * <ul>
 * <li>life style
 *  (1. without moving, siting work, television... (+20-40% from BEE) ,
 *   2. middle activity, siting work, move, buying, home working (+40-60% from BEE) ,
 *   3. high activity, physical work, psychical hard work, move, dont do sport yet (+60-80% from BEE) ,
 *  )</li>
 * <li>smoking (+10%)</li>
 * <li>regular sporting (+10%)</li>
 * </ul>
 * @author nue
 *
 */
public class BasalMetabolisms {

	private String sex;
	/** in kg */
	private int weight;
	/** in cm */
	private int height;
	private int age;
	/** Basal Energy Expenditure */
	private double bee;
	
	/**
	 * compute basic basal metabolism based on sex,weight,heoght,age.
	 * source: www.fitnesspark.sk
	 * @param sex ignore case (man, another string)
	 * @param weight
	 * @param height
	 * @param age
	 */
	public BasalMetabolisms(String sex,int weight,int height,int age) {
		this.age = age;
		this.height = height;
		this.sex = sex;
		this.weight = weight;
		if(this.sex.equalsIgnoreCase("man")) {
			this.bee = this.computeMan();
		} else {
			this.bee = this.computeWoman();
		}
	}
	
	private double computeMan() {
		return 66+(13.7*this.weight+5*this.height)-(6.8*this.age);
	}
	
	private double computeWoman() {
		return 65+(9.6*this.weight+5*this.height)-(4.7*this.age);
	}
	
	/**
	 * get basic basal metabolism
	 * @return basal in Kcal
	 */
	public double getBasalMetabolisms() {
		return this.bee;
	}

	public String getSex() {
		return sex;
	}

	public int getWeight() {
		return weight;
	}

	public int getHeight() {
		return height;
	}

	public int getAge() {
		return age;
	}
}
